<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<c:set var="sub_grant_code" scope="page">
	<x:out select="$xmlData/data/proposal/sub_grant_code" />
</c:set>
<script type="text/javascript">
	function chooseUploadType(trId, type) {
		if (type == "upload") {
			if (!confirm("切换到方法一模式会清空您输入的文本，是否需要切换")) {
				$("#note1 input[name='check']:checked").attr("checked", false);
				$($("#note1 input[name='check']").get(1)).attr("checked", true);
				return;
			}
			$("#prpContent_text").find("textarea").text("");

		}
		$("table[id^='" + trId + "']").each(function() {
			if ($(this).attr("id") == trId + "_" + type) {
				$(this).show();

			} else {
				$(this).hide();
			}
		});
	}

	$(function($) {
		var fileObj = $("#feaReport_upload1").find("span[name$='file_name']");
		var fileName = $("#fileNameHid").val();// 获得文件名
		var start = fileName.substring(0, fileName.indexOf("."));// 获得前缀
		var end = fileName
				.substring(fileName.indexOf(".") + 1, fileName.length);// 获得后缀
		var image = "";
		$("#contentImage").remove();
		if (end.toLowerCase() == "doc" || end.toLowerCase() == "docx") {
			image = "<img id=\"contentImage\" src=\"" + res
					+ "/images/ico_word.gif\">";
		} else if (end.toLowerCase() == "pdf") {
			image = "<img id=\"contentImage\" src=\"" + res
					+ "/images/ico_pdf.gif\">";
		} else if (end.toLowerCase() == "wps") {
			image = "<img id=\"contentImage\" src=\"" + res
					+ "/images/ico_wps.gif\">";
		}
		//fileObj.before(image);
		//fileObj.html(fileName);
	});
	/**
	 * 下载可行性报告 将抽取至public.js 中
	 */
	function ContentDownDesc(template) {

		window.open("${res_app}/template/content/"+ encodeURIComponent(template));

	}

</script>
<c:set var="grantCode">
	<x:out select="$xmlData/data/proposal/grant_code" />
</c:set>
<c:set var="subGrantCode">
	<x:out select="$xmlData/data/proposal/sub_grant_code" />
</c:set>
<c:set var="file_code">
	<x:out select="$xmlData/data/content/file_code" />
</c:set>

<table id="feaReport_upload1"
		<c:if test="${file_txt!=null&&file_txt!=''}" > style="display:none"</c:if>>
<tr id="feaReport_upload1"  <c:if test="${file_code ==''}"> style="display:none" </c:if>>
	<td>
		<input type="hidden" id="fileNameHid" value="<x:out select="$xmlData/data/content/file_name" />"/>
		已经上传的${title}：
		<a id="content_downLoadFileqhh" href="${ctx}/file/ajax-filedownload?fileCode=${file_code}" class="link_x" >
			<span>
				<x:out select="$xmlData/data/content/file_name" />
			</span>
		</a>&nbsp;&nbsp;
		(上传时间<span><x:out select="$xmlData/data/content/file_date" />
	     </span>)
	</td>
</tr>
<tr id="feaReport_upload1" <c:if test="${file_code !=''}"> style="display:none" </c:if> >
	<td>
		未上传${title}
	</td>
</tr>

</table>